
function viewCancelForm(){
	setTimeout($.unblockUI, 0); 
}


function viewForms(formName,largura,ditancia){
	
	$.blockUI({ 
		message: $('#'+ formName),
		css: { 
			top:  ($(window).height() - 400) /2 + 'px', 
	                left: ($(window).width() - largura) /2 + 'px', 
			width: largura + 'px' }    
	}); 
	

}


function ExibirMsg(tipo,msg){

	document.getElementById('painel_avisos').hidden = false;

	switch(tipo){
	
		case 1://Confimação
			document.getElementById('txAvisosErro').hidden = true;
	   		document.getElementById('txAvisosConf').hidden = false;
	   		document.getElementById('txAvisosConf').innerHTML = msg; 
			break;
	
		case -1://Erro
			document.getElementById('txAvisosErro').hidden = false;
	   		document.getElementById('txAvisosConf').hidden = true;
	   		document.getElementById('txAvisosErro').innerHTML = msg; 		
			break;


	}
}

function fechaMsg(){

	document.getElementById('painel_avisos').hidden = true;

}


function btCancelar(urlpag){

	window.location = urlpag;
}


/*Menu*/

		$(document).ready(function(){
			
			$("#menu_left ul li ul").hide();			

			$("#menu_left ul li").click(function(){
				
					$("#menu_left ul li ul").slideUp();	
				
				if($(this).contents("ul").is(":hidden"))
				{
					$(this).contents("ul").slideDown();
				}	
				else
				{
					$(this).contents("ul").slideUp();
				}
					
			});

		});
